unit fRealnoHint;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, RzLstBox, RzDBList, uDAScriptingProvider, uDADataTable,
  uDAMemDataTable, DB, uDAInterfaces, fClientDataModule, cxGraphics, cxControls,
  cxLookAndFeels, cxLookAndFeelPainters, cxStyles, dxSkinsCore, dxSkinCaramel,
  dxSkinOffice2010Silver, dxSkinSeven, dxSkinscxPCPainter, cxCustomData,
  cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxGridCustomView,
  cxGrid;

type
  TfmRealnoHint = class(TForm)
    dsRealno: TDADataSource;
    tblRealno: TDAMemDataTable;
    tvRealno: TcxGridDBTableView;
    lvRealno: TcxGridLevel;
    grdRealno: TcxGrid;
    tvRealnoValue: TcxGridDBColumn;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure DoFilter(aText: string);
    procedure ReOpen;
  end;

var
  fmRealnoHint: TfmRealnoHint;

implementation

{$R *.dfm}

procedure TfmRealnoHint.DoFilter(aText: string);
var
strtmp :string;
begin
  tblRealno.Filtered :=False;
  if not (aText = '') then
  begin



    strtmp := '%'+aText+'%';
    tblRealno.DisableControls;
    try
//      tblRealno.Filter :='bpi_realno like '+QuotedStr(strtmp);
//      tblRealno.Filtered := True;
    finally
      tblRealno.EnableControls;
    end;
  end;
  Show;
end;

procedure TfmRealnoHint.ReOpen;
begin
  tblRealno.Close;
  tblRealno.Filtered := False;
  tblRealno.Open;
end;

procedure TfmRealnoHint.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  tblRealno.Close;
  Action := caFree;
end;

procedure TfmRealnoHint.FormCreate(Sender: TObject);
begin
  tblRealno.Open;
end;

end.
